package com.singerw.service;

import com.singerw.utils.OSSUtils;
import com.singerw.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @version V1.0
 * @Package com.singerw.service
 * @auhter 张欣
 * @date 2021/1/23-5:15 PM
 */

@Service
public class LogService {

    private final RedisUtils redisUtils;

    @Autowired
    public LogService(RedisUtils redisUtils) {
        this.redisUtils = redisUtils;
    }

    public void addLog(Object o){
        String key = "log:" + OSSUtils.uuid();
        redisUtils.putOneDay(key,o);

    }
    public void addLog(Object o,boolean isLogin){
        String key = "loginLog:" + OSSUtils.uuid();
        redisUtils.putOneDay(key,o);
    }

    public String LogList(){
        return redisUtils.getPrefix("log:");
    }
    public String LoginList(){
        return redisUtils.getPrefix("loginLog:");

    }



}
